x11: Be quiet on exit by default
authorMatthias Clasen <mclasen@redhat.com>
Tue, 13 Apr 2021 18:52:09 +0000 (14:52 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 13 Apr 2021 18:52:48 +0000 (14:52 -0400)
The condition we check for to catch X servers going away
may not be accurate anymore, and the warning shows up in
logs, causing customers to be concerned. So, be quiet by
default, unless the user explicitly asked for a message.

gdk/x11/gdkmain-x11.c

index 8fc8253295a41ccde42a331b5672492991733889..55afd7f036b5b39ac9325ff67d1c17c280a5003c 100644 (file)
@@ -185,24 +185,13 @@ gdk_x_io_error (Display *display)
   /* This is basically modelled after the code in XLib. We need
    * an explicit error handler here, so we can disable our atexit()
    * which would otherwise cause a nice segfault.
-   * We fprintf(stderr, instead of g_warning() because g_warning()
-   * could possibly be redirected to a dialog
+   * We g_debug() instead of g_warning(), because g_warning()
+   * could possibly be redirected to the log
    */
-  if (errno == EPIPE)
-    {
-      g_message ("The application '%s' lost its connection to the display %s;\n"
-                 "most likely the X server was shut down or you killed/destroyed\n"
-                 "the application.\n",
-                 g_get_prgname (),
-                 display ? DisplayString (display) : NULL);
-    }
-  else
-    {
-      g_message ("%s: Fatal IO error %d (%s) on X server %s.\n",
-                 g_get_prgname (),
-                 errno, g_strerror (errno),
-                 display ? DisplayString (display) : NULL);
-    }
+  g_debug ("%s: Fatal IO error %d (%s) on X server %s.\n",
+           g_get_prgname (),
+           errno, g_strerror (errno),
+           display ? DisplayString (display) : "");
 
   _exit (1);
 }